<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SSE Example</title>
</head>
<body>
<h1>SSE Messages:</h1>
<div id="sse-messages"></div>
<script>
    const eventSource = new EventSource('/oneStream');
    const messagesDiv = document.getElementById('sse-messages');

    // const eventSource = new EventSource('/sse');
    // const messagesDiv = document.getElementById('sse-messages');


    eventSource.onmessage = function(event) {
        const p = document.createElement('p');
        p.textContent = event.data;
        messagesDiv.appendChild(p);
    };

    eventSource.onerror = function(error) {
        console.error("EventSource failed:", error);
    };
</script>
</body>
</html>